package com.bvgol.examples.my.thread.threadpool;/**
 * @Classname ThreadPollExectorTest
 * @Description TODO
 * @Date 2021/2/27 22:58
 * @Created by GUOCHEN
 */

import java.time.LocalDateTime;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @program: my-spring-completely
 * @description:
 * @author: GUOCHEN
 * @create: 2021/02/27 22:58
 */
public class ThreadPollExectorTest {
    public static void main(String[] args) {
//        TimeUnit unit;
//        BlockingQueue workQueue;
//        ThreadPoolExecutor threadPoolExecutor =new ThreadPoolExecutor(, , , unit, workQueue)

        ThreadPollExectorTest.poolTask();
    }

    public static void poolTask() {
        ScheduledExecutorService pool = Executors.newScheduledThreadPool(10);
        System.out.println("开始" + LocalDateTime.now());
        System.out.println("------------------------------------");
        pool.scheduleAtFixedRate(() -> {
            System.out.println("hi, 欢迎关注：Java技术栈:::::" + Thread.currentThread().getName() + "::::" + LocalDateTime.now());
        }, 2000, 3000, TimeUnit.MILLISECONDS);
    }

}
